package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-保修情况
type vehicleMaintainGuaranteeType int

var VehicleMaintainGuaranteeType vehicleMaintainGuaranteeType

// 保修内
func (c *vehicleMaintainGuaranteeType) Guarantee() int {
	return 1
}

// 过保修
func (c *vehicleMaintainGuaranteeType) OverGuarantee() int {
	return 2
}

// 其他
func (c *vehicleMaintainGuaranteeType) Others() int {
	return 3
}

func (c *vehicleMaintainGuaranteeType) ToText(value int) string {
	switch value {

	case 1:
		return "保修内"

	case 2:
		return "过保修"

	case 3:
		return "其他"

	}
	return ""
}

func (c *vehicleMaintainGuaranteeType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainGuaranteeType) ToValue(text string) int {
	switch text {

	case "保修内":
		return 1

	case "过保修":
		return 2

	case "其他":
		return 3

	}
	return 0
}
